home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / REmovido / Puzzle / yeti.swf / scripts / __Packages / CIndicator.as < prev    next >
Text File  |  2006-06-07  |  886b  |  40 lines

  1. class CIndicator extends MovieClip
  2. {
  3.    function CIndicator()
  4.    {
  5.       super();
  6.    }
  7.    function init(maxValue_)
  8.    {
  9.       var _loc1_ = this;
  10.       _loc1_.maxValue = maxValue_;
  11.       _loc1_.curValue = 0;
  12.       _loc1_.startY = _loc1_.mc_mask._y;
  13.       _loc1_.updateView();
  14.    }
  15.    function addValue(val)
  16.    {
  17.       var _loc1_ = this;
  18.       _loc1_.curValue += val;
  19.       if(_loc1_.curValue > _loc1_.maxValue)
  20.       {
  21.          _loc1_.curValue = _loc1_.maxValue;
  22.       }
  23.       _loc1_.updateView();
  24.    }
  25.    function reset()
  26.    {
  27.       this.curValue = 0;
  28.       this.updateView();
  29.    }
  30.    function isFull()
  31.    {
  32.       return this.curValue >= this.maxValue;
  33.    }
  34.    function updateView()
  35.    {
  36.       var _loc1_ = this;
  37.       _loc1_.mc_mask._y = _loc1_.startY + _loc1_.mc_mask._height - _loc1_.curValue / _loc1_.maxValue * _loc1_.mc_mask._height;
  38.    }
  39. }
  40.